<?php
namespace app\index\validate;
use think\Validate;
class Member extends Validate{

    // 验证规则
    protected $rule = [

        ['email', 'require|email|unique:member,email', '请填写邮箱|邮箱格式不正确！|该邮箱已注册，请换一个邮箱试试！'],
        ['password', 'require|length:6,20|^[\d\w~!@#$%^&*()+-=\\\]{6,20}+$', '请填写密码|长度在6--20位之间！|密码包含非法字符！'],
        ['cpassword', 'require|confirm:password', '请填写确认密码！|两次密码输入不一致！'],
        ['chkcode', 'require|captcha', '请填写验证码！|验证码错误！'],
    ];
    
    protected $scene = [
        'regist'  =>  ['email','password','cpassword','chkcode'],
        'login'  =>  ['password','chkcode'],
    ];

      
}